package com.muki.spider.core.filter;

import com.muki.spider.core.FilterChain;
import com.muki.spider.core.FlagUri;
import com.muki.spider.core.RequestUri;
import com.muki.spider.core.UriFilter;

public class DepthFilter implements UriFilter {

	@Override
	public void filter(RequestUri request, FilterChain chain) {
		FlagUri uri = request.getFlagUri();
		if(uri.getDepth()<2) {
			chain.doFilter(request);
		}
	}

	@Override
	public void destroy() {
		
	}

	@Override
	public void init() {
		
	}

}
